package com.qumitech.visualnovel.datasource.app;

import java.util.*;
import org.apache.ibatis.annotations.*;
import com.qumitech.visualnovel.model.dto.BookNumberDTO;
import com.qumitech.visualnovel.model.dao.app.UserBookDO;
import com.qumitech.visualnovel.model.dto.BookReadQueryDTO;

public interface UserBookDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UserBookDO record);

    int insertSelective(UserBookDO record);

    UserBookDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserBookDO record);

    int updateByPrimaryKey(UserBookDO record);

    UserBookDO selectRecord(@Param("uid") Long uid);

    int total(BookReadQueryDTO param);

    List<UserBookDO> list(BookReadQueryDTO param);

    BookNumberDTO getUserReadNum(@Param("uid") Long uid, @Param("bookId") Long bookId);

    @MapKey("key")
    Map<String, BookNumberDTO> getBookReadCostMap(@Param("uid") Long uid, @Param("bookIdList") List<Long> bookIdList);

    Integer getDashboardUnlockNum(@Param("tableName") String tableName, @Param("fieldName") String fieldName);
}